import store from "@/store";
const { POST, GET } = store.getters.props.req;

export function getDefaultAnimes(param: Object) {
  const baseUrl = store.getters.props.config.api;
  return POST(baseUrl + `/anime/find`, "分页获取默认排行数据", param);
}

export function getAnimes(param: Object) {
  const baseUrl = store.getters.props.config.api;
  return POST(baseUrl + `/anime/getCompList`, "获取追番列表", param);
}

export function getStatisticData(param: Object, isDefault: Boolean) {
  const baseUrl = store.getters.props.config.api;
  return POST(baseUrl + `/anime/getStaticData`, "获取统计数据", {
    weight: param,
    isDefault
  });
}

export function getStatisticList(param: Object) {
  const baseUrl = store.getters.props.config.api;
  return POST(baseUrl + `/anime/getStaticList`, "获取统计列表", param);
}

export function updateInfo(id: Number, param: Object) {
  const baseUrl = store.getters.props.config.api;
  return POST(baseUrl + `/anime/updateDid/${id}`, "关联豆瓣数据", param);
}
